/*
 * Created by JFormDesigner on Sat Dec 17 11:56:33 CST 2022
 */

package view.menu;

import java.awt.*;
import javax.swing.*;
import javax.swing.table.DefaultTableModel;

import com.jgoodies.forms.factories.*;

/**
 * @author 1
 */
public class AdminUserMenuView extends JFrame {
    public static void main(String[] args) {
        AdminUserMenuView adminUserMenu = new AdminUserMenuView();
        adminUserMenu.setVisible(true);
    }
    public AdminUserMenuView() {
        initComponents();
    }

    private void initComponents() {
        // JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents  @formatter:off
        DefaultComponentFactory compFactory = DefaultComponentFactory.getInstance();
        Menu = new JPanel();
        adminMenu = new JTabbedPane();
        userManager = new JPanel();
        panel7 = new JPanel();
        label7 = compFactory.createLabel("\u7528\u6237id:");
        id = new JTextField();
        label8 = compFactory.createLabel("\u7528\u6237\u8d26\u53f7\uff1a");
        username = new JTextField();
        label9 = compFactory.createLabel("\u7528\u6237\u5bc6\u7801\uff1a");
        password = new JTextField();
        scrollPane2 = new JScrollPane();
        // 表头（列名）
        Object[] userColumnNames = {"Id", "用户名", "密码"};
        userModel = new DefaultTableModel(userRowData, userColumnNames) {
            @Override
            public boolean isCellEditable(int row, int column) { // 表格不可编辑
                return false;
            }
        };
        userTable = new JTable();
        userTable.setModel(userModel);
        panel9 = new JPanel();
        userShow = new JButton();
        userSearch = new JButton();
        userRevise = new JButton();
        userDelete = new JButton();
        userInsert = new JButton();
        userF5 = new JButton();
        bookManager = new JPanel();
        panel4 = new JPanel();
        label2 = compFactory.createLabel("\u56fe\u4e66id:");
        bookId = new JTextField();
        label3 = compFactory.createLabel("\u56fe\u4e66\u540d\u79f0\uff1a");
        bookName = new JTextField();
        label5 = compFactory.createLabel("\u56fe\u4e66\u4f5c\u8005\uff1a");
        bookAuthor = new JTextField();
        label6 = compFactory.createLabel("\u51fa\u7248\u793e\uff1a");
        bookPre = new JTextField();
        s = compFactory.createLabel("\u72b6\u6001\uff1a");
        state = new JPanel();
        noOut = new JRadioButton();
        hadOut = new JRadioButton();
        scrollPane1 = new JScrollPane();
        // 表头（列名）
        Object[] bookColumnNames = {"Id", "图书名称", "作者","出版社","状态"};

        bookModel = new DefaultTableModel(bookRowData, bookColumnNames) {
            @Override
            public boolean isCellEditable(int row, int column) { // 表格不可编辑
                return false;
            }
        };
        bookTable = new JTable();
        bookTable.setModel(bookModel);
        panel6 = new JPanel();
        bookShow = new JButton();
        bookSearch = new JButton();
        bookRevise = new JButton();
        bookDelete = new JButton();
        bookInsert = new JButton();
        bookF5 = new JButton();
        recordManager = new JPanel();
        scrollPane3 = new JScrollPane();
        Object[] recordColumnNames = {"Id", "图书id", "用户id","借出时间","归还时间"};
        recordModel = new DefaultTableModel(recordRowData, recordColumnNames) {
            @Override
            public boolean isCellEditable(int row, int column) { // 表格不可编辑
                return false;
            }
        };
        recordTable = new JTable();
        recordTable.setModel(recordModel);

        //======== this ========
        setMinimumSize(new Dimension(735, 600));
        setTitle("\u7ba1\u7406\u5458\u83dc\u5355");
        Container contentPane = getContentPane();
        contentPane.setLayout(new BorderLayout());

        //======== Menu ========
        {
            Menu.setLayout(new BorderLayout());

            //======== adminMenu ========
            {
                adminMenu.setFont(adminMenu.getFont().deriveFont(adminMenu.getFont().getSize() + 5f));

                //======== userManager ========
                {
                    userManager.setLayout(new BorderLayout());

                    //======== panel7 ========
                    {
                        panel7.setMaximumSize(new Dimension(20, 30));
                        panel7.setLayout(new GridLayout(3, 2, 0, 150));

                        //---- label7 ----
                        label7.setFont(label7.getFont().deriveFont(label7.getFont().getSize() + 10f));
                        label7.setHorizontalAlignment(SwingConstants.CENTER);
                        panel7.add(label7);
                        panel7.add(id);

                        //---- label8 ----
                        label8.setHorizontalAlignment(SwingConstants.CENTER);
                        label8.setFont(label8.getFont().deriveFont(label8.getFont().getSize() + 10f));
                        panel7.add(label8);
                        panel7.add(username);

                        //---- label9 ----
                        label9.setHorizontalAlignment(SwingConstants.CENTER);
                        label9.setFont(label9.getFont().deriveFont(label9.getFont().getSize() + 10f));
                        panel7.add(label9);
                        panel7.add(password);
                    }
                    userManager.add(panel7, BorderLayout.WEST);

                    //======== scrollPane2 ========
                    {

                        //---- userList ----
                        userTable.setFont(userTable.getFont().deriveFont(userTable.getFont().getSize() + 5f));
                        scrollPane2.setViewportView(userTable);
                    }
                    userManager.add(scrollPane2, BorderLayout.CENTER);

                    //======== panel9 ========
                    {
                        panel9.setLayout(new GridLayout(2, 4, 10, 0));

                        //---- userShow ----
                        userShow.setText("\u663e\u793a\u6240\u6709");
                        userShow.setFont(userShow.getFont().deriveFont(userShow.getFont().getSize() + 5f));
                        panel9.add(userShow);

                        //---- userSearch ----
                        userSearch.setText("\u67e5\u8be2");
                        userSearch.setFont(userSearch.getFont().deriveFont(userSearch.getFont().getSize() + 5f));
                        panel9.add(userSearch);

                        //---- userRevise ----
                        userRevise.setText("\u4fee\u6539");
                        userRevise.setFont(userRevise.getFont().deriveFont(userRevise.getFont().getSize() + 5f));
                        panel9.add(userRevise);

                        //---- userDelete ----
                        userDelete.setText("\u5220\u9664");
                        userDelete.setFont(userDelete.getFont().deriveFont(userDelete.getFont().getSize() + 5f));
                        panel9.add(userDelete);

                        //---- userInsert ----
//                        userInsert.setText("\u65b0\u589e\u7528\u6237");
//                        userInsert.setFont(userInsert.getFont().deriveFont(userInsert.getFont().getSize() + 5f));
//                        panel9.add(userInsert);

                        //---- userF5 ----
                        userF5.setText("\u5237\u65b0");
                        userF5.setFont(userF5.getFont().deriveFont(userF5.getFont().getSize() + 5f));
                        userF5.setMinimumSize(new Dimension(2000, 600));
                        panel9.add(userF5);
                    }
                    userManager.add(panel9, BorderLayout.SOUTH);
                }
                adminMenu.addTab("\u7528\u6237\u7ba1\u7406", userManager);

                //======== bookManager ========
                {
                    bookManager.setLayout(new BorderLayout());

                    //======== panel4 ========
                    {
                        panel4.setLayout(new GridLayout(5, 2, 0, 70));

                        //---- label2 ----
                        label2.setFont(label2.getFont().deriveFont(label2.getFont().getSize() + 10f));
                        label2.setHorizontalAlignment(SwingConstants.CENTER);
                        panel4.add(label2);
                        panel4.add(bookId);

                        //---- label3 ----
                        label3.setHorizontalAlignment(SwingConstants.CENTER);
                        label3.setFont(label3.getFont().deriveFont(label3.getFont().getSize() + 10f));
                        panel4.add(label3);
                        panel4.add(bookName);

                        //---- label5 ----
                        label5.setHorizontalAlignment(SwingConstants.CENTER);
                        label5.setFont(label5.getFont().deriveFont(label5.getFont().getSize() + 10f));
                        panel4.add(label5);
                        panel4.add(bookAuthor);

                        //---- label6 ----
                        label6.setHorizontalAlignment(SwingConstants.CENTER);
                        label6.setFont(label6.getFont().deriveFont(label6.getFont().getSize() + 10f));
                        panel4.add(label6);
                        panel4.add(bookPre);

                        //---- s ----
                        s.setHorizontalAlignment(SwingConstants.CENTER);
                        s.setFont(s.getFont().deriveFont(s.getFont().getSize() + 10f));
                        panel4.add(s);

                        //======== state ========
                        {
                            state.setLayout(new GridLayout(1, 2));

                            //---- noOut ----
                            noOut.setText("可借   ");
                            noOut.setFont(noOut.getFont().deriveFont(noOut.getFont().getSize() + 5f));
                            state.add(noOut);

                            //---- hadOut ----
//                            hadOut.setText("\u5df2\u501f\u51fa");
//                            hadOut.setFont(hadOut.getFont().deriveFont(hadOut.getFont().getSize() + 5f));
//                            state.add(hadOut);
                        }
                        panel4.add(state);
                    }
                    bookManager.add(panel4, BorderLayout.WEST);

                    //======== scrollPane1 ========
                    {

                        //---- bookList ----
                        bookTable.setFont(bookTable.getFont().deriveFont(bookTable.getFont().getSize() + 5f));
                        scrollPane1.setViewportView(bookTable);
                    }
                    bookManager.add(scrollPane1, BorderLayout.CENTER);

                    //======== panel6 ========
                    {
                        panel6.setLayout(new GridLayout(2, 4, 10, 0));

                        //---- bookShow ----
                        bookShow.setText("\u663e\u793a\u6240\u6709");
                        bookShow.setFont(bookShow.getFont().deriveFont(bookShow.getFont().getSize() + 5f));
                        panel6.add(bookShow);

                        //---- bookSearch ----
                        bookSearch.setText("\u67e5\u8be2");
                        bookSearch.setFont(bookSearch.getFont().deriveFont(bookSearch.getFont().getSize() + 5f));
                        panel6.add(bookSearch);

                        //---- bookRevise ----
                        bookRevise.setText("\u4fee\u6539");
                        bookRevise.setFont(bookRevise.getFont().deriveFont(bookRevise.getFont().getSize() + 5f));
                        panel6.add(bookRevise);

                        //---- bookDelete ----
                        bookDelete.setText("\u5220\u9664");
                        bookDelete.setFont(bookDelete.getFont().deriveFont(bookDelete.getFont().getSize() + 5f));
                        panel6.add(bookDelete);

                        //---- bookInsert ----
                        bookInsert.setText("\u65b0\u589e\u56fe\u4e66");
                        bookInsert.setFont(bookInsert.getFont().deriveFont(bookInsert.getFont().getSize() + 5f));
                        panel6.add(bookInsert);

                        //---- bookF5 ----
                        bookF5.setText("\u5237\u65b0");
                        bookF5.setFont(bookF5.getFont().deriveFont(bookF5.getFont().getSize() + 5f));
                        bookF5.setMinimumSize(new Dimension(2000, 600));
                        panel6.add(bookF5);
                    }
                    bookManager.add(panel6, BorderLayout.SOUTH);
                }
                adminMenu.addTab("\u56fe\u4e66\u7ba1\u7406", bookManager);

                //======== recordManager ========
                {
                    recordManager.setLayout(new BorderLayout());

                    //======== scrollPane3 ========
                    {
                        scrollPane3.setViewportView(recordTable);
                    }
                    recordManager.add(scrollPane3, BorderLayout.CENTER);
                }
                adminMenu.addTab("\u501f\u8fd8\u7ba1\u7406", recordManager);
            }
            Menu.add(adminMenu, BorderLayout.CENTER);
        }
        contentPane.add(Menu, BorderLayout.CENTER);
        pack();
        setLocationRelativeTo(getOwner());
        // JFormDesigner - End of component initialization  //GEN-END:initComponents  @formatter:on
    }

    // JFormDesigner - Variables declaration - DO NOT MODIFY  //GEN-BEGIN:variables  @formatter:off
    private JPanel Menu;
    private JTabbedPane adminMenu;
    private JPanel userManager;
    private JPanel panel7;
    private JLabel label7;
    private JTextField id;
    private JLabel label8;
    private JTextField username;
    private JLabel label9;
    private JTextField password;
    private JScrollPane scrollPane2;
    private JTable userTable;
    private JPanel panel9;
    private JButton userShow;
    private JButton userSearch;
    private JButton userRevise;
    private JButton userDelete;
    private JButton userInsert;
    private JButton userF5;
    private JPanel bookManager;
    private JPanel panel4;
    private JLabel label2;
    private JTextField bookId;
    private JLabel label3;
    private JTextField bookName;
    private JLabel label5;
    private JTextField bookAuthor;
    private JLabel label6;
    private JTextField bookPre;
    private JLabel s;
    private JPanel state;
    private JRadioButton noOut;
    private JRadioButton hadOut;
    private JScrollPane scrollPane1;
    private JTable bookTable;
    private JPanel panel6;
    private JButton bookShow;
    private JButton bookSearch;
    private JButton bookRevise;
    private JButton bookDelete;
    private JButton bookInsert;
    private JButton bookF5;
    private JPanel recordManager;
    private JScrollPane scrollPane3;
    private JTable recordTable;
    private Object[] columnNames;
    private DefaultTableModel bookModel;
    private DefaultTableModel userModel;
    private DefaultTableModel recordModel;
    private Object[][] userRowData={};
    private Object[][] bookRowData={};
    private Object[][] recordRowData={};
    public DefaultTableModel getBookModel() {
        return bookModel;
    }

    public DefaultTableModel getUserModel() {
        return userModel;
    }

    public DefaultTableModel getRecordModel() {
        return recordModel;
    }

    public JButton getBookDelete() {
        return bookDelete;
    }

    public JTable getUserTable() {
        return userTable;
    }

    public JTable getBookTable() {
        return bookTable;
    }

    public JTable getRecordTable() {
        return recordTable;
    }

    public JPanel getUserManager() {
        return userManager;
    }

    public JButton getUserDelete() {
        return userDelete;
    }

    public JPanel getBookManager() {
        return bookManager;
    }

    public JPanel getMenu() {
        return Menu;
    }

    public JTextField getId() {
        return id;
    }

    public JTextField getUsername() {
        return username;
    }

    public JTextField getPassword() {
        return password;
    }

    public JButton getUserShow() {
        return userShow;
    }

    public JButton getUserSearch() {
        return userSearch;
    }

    public JButton getUserRevise() {
        return userRevise;
    }

    public JButton getUserInsert() {
        return userInsert;
    }

    public JButton getUserF5() {
        return userF5;
    }

    public JTextField getBookId() {
        return bookId;
    }

    public JTextField getBookName() {
        return bookName;
    }

    public JTextField getBookAuthor() {
        return bookAuthor;
    }

    public JTextField getBookPre() {
        return bookPre;
    }

    public JRadioButton getNoOut() {
        return noOut;
    }

    public JRadioButton getHadOut() {
        return hadOut;
    }

    public JButton getBookShow() {
        return bookShow;
    }

    public JButton getBookSearch() {
        return bookSearch;
    }

    public JButton getBookRevise() {
        return bookRevise;
    }

    public JButton getBookInsert() {
        return bookInsert;
    }

    public JButton getBookF5() {
        return bookF5;
    }
    // JFormDesigner - End of variables declaration  //GEN-END:variables  @formatter:on
}
